﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WF_Process_HandleInfo.aspx.vb"
    Inherits="MyWorkflow.WF_Process_HandleInfo" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
    <script type="text/javascript" src="js/wf_chart_V2.js" ></script>
    <script language="javascript" src="Workflow.js"></script>   
    <script language="javascript" src="js/wf_cancelBackSpace.js"></script>
	<%--BUG 45625 sunfx 2009年5月11日17:07:39 END--%> 
    <script type="text/javascript">
        var bPreviewLoaded = false;
        function WF_Load()
        {   
            showDiv("Grid");            
        }
        function showDiv(mode){
            var divGrid = $id("divGrid");
            var divChart = $id("divChart");
            var labRefurbish = $id("labRefurbish");
            var strHTML = "";
            switch(mode){
                case "Grid":
                    var pmGuid = $id("txtProcessGUID").value;
                    //需要重新收集XML    
                    var domainXml = parent.oprGetDomainXml();
                    if (domainXml==false) domainXml = "";
                    var mode = parent.$id("__mode").value;
                    
                    if( !bPreviewLoaded){
                        getProcessInitiatePreviewXML(pmGuid,domainXml);
                        bPreviewLoaded = true;               
                    }
                    labRefurbish.style.display = "";
                    divGrid.style.display = "";
                    divChart.style.display = "none";
                    break;
                case "Chart":
                    $id("rdChartMode").checked = true;
                    divGrid.style.display = "none";
                    WF_DrawGraph_Load();
                    WF_DrawGraph();
                    labRefurbish.style.display = "none";
                    divChart.style.display = "block";
                    break;
            }
        }
        function getProcessInitiatePreviewXML(processguid,domainXml)
        {
            var sHTML = new StringBuilder();
	
	        sHTML.append("<table width='100%'>");
	        sHTML.append( "<tr>");
	        sHTML.append( "<td id='_sheet'>");
	        sHTML.append(">>>>>正在打开路径预览，请稍候......");
	        sHTML.append("</td>");
	        sHTML.append( "</tr>");
	        sHTML.append( "<tr height='10px'><td></td></tr>");
        		
	        //显示路径预览
	        myXmlHttp.callByAsync("/MyWorkflow/WF_XMLHTTP.aspx?ywtype=INITATEPREVIEW&ywonlyflag="+processguid+"&rnd=" + Math.random(),domainXml,loadHtmlAsync);
	       
        	
	        sHTML.append( "</table>");
         
	        $id("divGrid").innerHTML = sHTML.toString();
        }
        //异步获取路径预览
        function loadHtmlAsync(sText)
        {
	        try
	        {
		        $id("divGrid").innerHTML = sText;
        		
	        }
	        catch(e) {}				 
        }
        function getProcessModuleXML(processguid)
        {
	        var xml
	        xml = GetDataFromXMLHTTP("/MyWorkflow/WF_XMLHTTP.aspx","GetProcessModuleXML",processguid,"","");
            if (xml != -1) 
                return xml;
            else
                return "";
        }
    </script>
    <style>
        html,body {height:100%;}
        #tabStrip
        {
	        width: 100%;
	        height: 100%;
        }
        #tabStrip #divGrid
        {   
            padding: 5px;
            height: 100%;
            border: 1px #7d7d7d solid;
	        background-color: #FFF;
	        width: 100%;
        }
        #tabStrip #divChart
        {
            height: 100%;
            border: 1px #7d7d7d solid;
	        background-color: #FFF;
	        width: 100%;
        }
    </style>
</head>
<body bgcolor="efefeb" onload="WF_Load()">

    <form id="Form1" method="post" runat="server" style="display:none">
			<asp:TextBox ID="txtProcessGUID"  style="display:none" runat="server"></asp:TextBox>
			<asp:TextBox ID="txtProcessMode"  style="display:none" runat="server"></asp:TextBox>
            <asp:TextBox ID="txtProcessXml" style="display:" runat="server"></asp:TextBox>            
            <input id="txtStepInfo" type="text" style="display:none">
    </form>
    
<div id="tabStrip"> 
    <table style="width:100%;height:100%" border ="0">
        <tr style="height:20px">
            <td>
                <input id="rdGridMode" name="rdMode" type="radio" checked onclick="showDiv('Grid')">表格展示
                <input id="rdChartMode" name="rdMode" type="radio" onclick="showDiv('Chart')">图形展示
            </td>
            <td align="right" valign="middle" >
                <label id="labRefurbish" style="text-decoration: underline;padding-right:10px; cursor:pointer" onclick="bPreviewLoaded=false;showDiv('Grid')">重新生成路径预览</label>
            </td>
        </tr>            
        <tr>
            <td colspan ="2" valign="top" style"background-color:red;">
                   <div id="divGrid"></div>
                   <div id="divChart">
                        <iframe id="ifrChart" src="" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
                   </div>
            </td>
        </tr>
    </table> 
</div>
</body>
</html>